<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>C#.NET编程----Spring.NET &amp; NHibernate整合(二) - Spring.Net &amp; NHibernate 技术中文站 - 博客园</title>
<meta name="keywords" content="C#.NET编程,Spring.NET,NHibernate整合">
<meta name="description" content="C#.NET编程----Spring.NET &amp; NHibernate整合(二) --NHibernate入门这是一个简单的NHibernate的例子。如果你没有触过Hibernate或NHibernate，你可以看一下，他会告诉你怎么在项目中使用NHibernate.">



<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/it1630/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/it1630/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head>
<body>
    <form name="Form1" method="post" action="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html" id="Form1">
<div>
<input name="__EVENTTARGET" id="__EVENTTARGET" value="" type="hidden">
<input name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" type="hidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>




        <div align="center">
<ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 90px; position: relative; visibility: visible; width: 728px;"><ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 90px; position: relative; visibility: visible; width: 728px;"><iframe allowtransparency="true" hspace="0" id="google_ads_frame1" marginheight="0" marginwidth="0" name="google_ads_frame" src="index_1.html" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" scrolling="no" frameborder="0" height="90" width="728"></iframe></ins></ins>
</div>
<div id="maincontainer">
	<div id="header">
		
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/it1630/">Spring.Net &amp; NHibernate 技术中文站</a></h1>
<div id="tagline"><span>Spring.NET &amp; NHibernate of C#.NET 技术论坛 <a href="http://www.springframework.cn/" class="smarterwiki-linkify">http://www.springframework.cn/</a></span></div>
<div id="menubar">
<div id="blogstats">
<span>posts(32)</span>
<span>comments(146)</span>
<span>trackbacks(5)</span>

</div>
<ul>
	<li><a id="Header1_MyLinks1_HomeLink" class="home" href="http://www.cnblogs.com/">博客园</a></li>
	<li><a id="Header1_MyLinks1_ContactLink" accesskey="9" class="contact" href="http://space.cnblogs.com/msg/send/%e3%8a%a3%e9%98%bf%e5%8d%8e">联系</a></li>
	<li><a id="Header1_MyLinks1_XMLLink" href="http://www.cnblogs.com/it1630/rss"><img src="xmlsmall.gif" alt="订阅" style="border-width: 0px;"></a>&nbsp;<a id="Header1_MyLinks1_Syndication" href="http://www.cnblogs.com/it1630/rss">订阅</a></li>
	<li><a id="Header1_MyLinks1_Admin" class="admin" href="http://www.cnblogs.com/it1630/admin/EditPosts.aspx">管理</a></li>		
</ul></div>




	</div>
	<div id="content">
		<div id="left" style="display: inline;">
			
				
<div class="container">
	<div class="containerheader"><h3>News</h3></div>
	<div class="containercontent">
		FastSpring技术支持论坛: <br>
<a href="http://www.springframework.cn/index.php" target="_top">www.springframework.cn</a> 


<div id="profile_block"><a href="http://home.cnblogs.com/it1630/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/it1630/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/it1630/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/%e3%8a%a3%e9%98%bf%e5%8d%8e" target="_top">发短消息</a></div>
	</div>
</div>

				
				

<div class="container">
<div class="containerheader">
<h3 class="catListTitle">搜索</h3>
</div>
<div class="containercontent">
<div class="div_my_zzk"><input value="" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk" type="text">&nbsp;<input onclick="zzk_go()" value="找找看" id="btnZzk" class="btn_my_zzk" type="button"></div>
</div>
</div>
<div class="container">
	<div class="containerheader">
<h3>常用链接</h3>
</div>
<div class="containercontent">
<ul>
		<li><a id="SingleColumn_ctl02_repeaterLinks_ctl01_lnkLinkItem" href="http://www.cnblogs.com/it1630/OtherPosts.html">我的参与</a></li>
	
		<li><a id="SingleColumn_ctl02_repeaterLinks_ctl02_lnkLinkItem" href="http://www.cnblogs.com/it1630/MyNews.html">我的新闻</a></li>
	
		<li><a id="SingleColumn_ctl02_repeaterLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/it1630/RecentComments.html">最新评论</a></li>
	
		<li><a id="SingleColumn_ctl02_repeaterLinks_ctl04_lnkLinkItem" href="http://www.cnblogs.com/it1630/tag/">我的标签</a></li>
	</ul>
</div>
</div>

<div class="container">
<div class="containerheader">
<h3>我的标签</h3>
</div>
<div class="containercontent">
<div id="MyTag">
<ul>
<li><a href="http://www.cnblogs.com/it1630/tag/Spring.NET/">Spring.NET</a>(6)</li><li><a href="http://www.cnblogs.com/it1630/tag/NHibernate/">NHibernate</a>(6)</li><li><a href="http://www.cnblogs.com/it1630/tag/FastSpring.NET/">FastSpring.NET</a>(5)</li><li><a href="http://www.cnblogs.com/it1630/tag/C%23/">C#</a>(4)</li><li><a href="http://www.cnblogs.com/it1630/tag/.NET/">.NET</a>(4)</li><li><a href="http://www.cnblogs.com/it1630/tag/%e4%ba%ba%e8%84%89%e9%80%9a/">人脉通</a>(3)</li><li><a href="http://www.cnblogs.com/it1630/tag/ProjectOffice/">ProjectOffice</a>(3)</li><li><a href="http://www.cnblogs.com/it1630/tag/PMS/">PMS</a>(2)</li><li><a href="http://www.cnblogs.com/it1630/tag/%e9%98%bf%e9%87%8c%e5%b7%b4%e5%b7%b4/">阿里巴巴</a>(2)</li><li><a href="http://www.cnblogs.com/it1630/tag/Ajax/">Ajax</a>(2)</li><li><a href="http://www.cnblogs.com/it1630/tag/">更多</a></li>
</ul>
</div>
</div>
</div>
		<div class="container">
			<div class="containerheader"><h3>随笔分类<span style="font-size: 11px; font-weight: normal;">(38)</span></h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to 精通篇(13)" class="rsslink" href="http://www.cnblogs.com/it1630/category/78360.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/it1630/category/78360.html">精通篇(13)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to 入门篇(5)" class="rsslink" href="http://www.cnblogs.com/it1630/category/78358.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/it1630/category/78358.html">入门篇(5)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to 提高篇(9)" class="rsslink" href="http://www.cnblogs.com/it1630/category/78359.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.cnblogs.com/it1630/category/78359.html">提高篇(9)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to 我的随笔(11)" class="rsslink" href="http://www.cnblogs.com/it1630/category/77467.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.cnblogs.com/it1630/category/77467.html">我的随笔(11)</a></li>
				
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	
		<div class="container">
			<div class="containerheader"><h3>随笔档案<span style="font-size: 11px; font-weight: normal;">(32)</span></h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.cnblogs.com/it1630/archive/2009/09.html">2009年9月 (3)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://www.cnblogs.com/it1630/archive/2009/08.html">2009年8月 (3)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl03_Link" href="http://www.cnblogs.com/it1630/archive/2009/06.html">2009年6月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl04_Link" href="http://www.cnblogs.com/it1630/archive/2009/05.html">2009年5月 (2)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl05_Link" href="http://www.cnblogs.com/it1630/archive/2009/04.html">2009年4月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl06_Link" href="http://www.cnblogs.com/it1630/archive/2008/05.html">2008年5月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl07_Link" href="http://www.cnblogs.com/it1630/archive/2008/04.html">2008年4月 (2)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl08_Link" href="http://www.cnblogs.com/it1630/archive/2008/02.html">2008年2月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl09_Link" href="http://www.cnblogs.com/it1630/archive/2008/01.html">2008年1月 (2)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl10_Link" href="http://www.cnblogs.com/it1630/archive/2007/11.html">2007年11月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl11_Link" href="http://www.cnblogs.com/it1630/archive/2007/10.html">2007年10月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl12_Link" href="http://www.cnblogs.com/it1630/archive/2007/09.html">2007年9月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl13_Link" href="http://www.cnblogs.com/it1630/archive/2007/08.html">2007年8月 (3)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl14_Link" href="http://www.cnblogs.com/it1630/archive/2007/06.html">2007年6月 (3)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl15_Link" href="http://www.cnblogs.com/it1630/archive/2006/12.html">2006年12月 (6)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl16_Link" href="http://www.cnblogs.com/it1630/archive/2006/11.html">2006年11月 (1)</a></li>
				
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	
		<div class="container">
			<div class="containerheader"><h3>文章分类<span style="font-size: 11px; font-weight: normal;">(2)</span></h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl01_RssLink" title="Subscribe to 精通篇" class="rsslink" href="http://www.cnblogs.com/it1630/category/77462.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl01_Link" href="http://www.cnblogs.com/it1630/category/77462.html">精通篇</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl02_RssLink" title="Subscribe to 入门篇(1)" class="rsslink" href="http://www.cnblogs.com/it1630/category/77460.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl02_Link" href="http://www.cnblogs.com/it1630/category/77460.html">入门篇(1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl03_RssLink" title="Subscribe to 提高篇(1)" class="rsslink" href="http://www.cnblogs.com/it1630/category/77461.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl03_Link" href="http://www.cnblogs.com/it1630/category/77461.html">提高篇(1)</a></li>
				
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	
		<div class="container">
			<div class="containerheader"><h3>文章档案<span style="font-size: 11px; font-weight: normal;">(2)</span></h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl03_LinkList_ctl01_Link" href="http://www.cnblogs.com/it1630/archives/2006/11.html">2006年11月 (2)</a></li>
				
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	
		<div class="container">
			<div class="containerheader"><h3>合作站点</h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl01_Link" href="http://www.51itsp.com/">ProjectOffice 项目管理</a></li>
				<li style="margin-top: 2px;">ProjectOffice 项目管理软件 项目管理系统</li>
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl02_Link" href="http://www.springframework.cn/" target="_top">Spring.net技术中文站</a></li>
				<li style="margin-top: 2px;">Spring.NET &amp; NHibernate of C#.NET 技术中文论坛</li>
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl03_Link" href="http://www.51muying.com/" target="_top">母婴网</a></li>
				<li style="margin-top: 2px;">母婴网(51muying.Com)是专业的母婴资讯网站。</li>
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl04_Link" href="http://www.alirenmai.com/" target="_top">人脉通</a></li>
				<li style="margin-top: 2px;">阿里人脉网--阿里巴巴开心网，阿里人脉通，阿里巴巴，人脉通</li>
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl05_Link" href="http://www.56easy.com/" target="_top">物流百科 物流知识</a></li>
				<li style="margin-top: 2px;">物流百科-物流知识|物流论文|第三方物流|物流技术|物流行业百科全书
</li>
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	


<h3 class="catListTitle">最新随笔</h3>
<div class="RecentComment" id="RecentPosts">
<ul style="">
	
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl00_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/09/14/1566179.html">1.&nbsp;KeyNotFoundException: 给定关键字不在字典中</a></li>
		
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl00_RecentPostsList2_ctl01_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/09/14/1566092.html">2.&nbsp;FastSpring.NET v4.1将使用Spring.NET1.3和NHibernate2.1</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl01_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/09/12/1565605.html">3.&nbsp;FastSpring.NET v4.1 Sample 提供下载(含FastSpring.NETv4.1bin版)</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl02_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/08/26/1554496.html">4.&nbsp;Spring.Net &amp; NHibernate 中文论坛重新开放！</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl03_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/08/20/1550808.html">5.&nbsp;FastSpring.NET v4.0 Sample 提供下载</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl04_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/08/14/1546178.html">6.&nbsp;母婴网(51muying.Com)</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl05_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/06/19/1506413.html">7.&nbsp;[推荐]物流百科-物流行业百科全书</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl06_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/28/1491380.html">8.&nbsp;今天收到阿里巴巴 人脉通体验邮件</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl07_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/07/1451282.html">9.&nbsp;新注册了个域名alirenmai.com大家看做个什么网站好？</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl08_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/04/24/1442708.html">10.&nbsp;马云涉足SNS社区? alirenmai.com正式启用</a></li>
		
	
</ul>
</div>

<div class="container">
<div class="containerheader"><h3>最新评论
	<a id="SingleColumn__1b122e90e8f1_RSSHyperlink1" href="http://www.cnblogs.com/it1630/CommentsRSS.aspx"><img src="xml.gif" style="border-width: 0px;"></a></h3></div>
	
			<ul style="" class="containercontent">
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl01_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/09/12/1565605.html#1644773">1.&nbsp;Re:FastSpring.NET v4.1 Sample 提供下载(含FastSpring.NETv4.1bin版)</a>
			</li>
			<li style="">
				有这么强大吗
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--jesery Liang</li>
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl02_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/28/1491380.html#1542734">2.&nbsp;re: 今天收到阿里巴巴 人脉通体验邮件</a>
			</li>
			<li style="">
				1楼的，你不是阿里巴巴“人脉通”的体验用户，当然你觉得是骗人。
<br>
<br>我相信只要是5188体验用户之一的人，看到截图肯定知道是怎么回事！
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--㊣阿华</li>
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl03_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/28/1491380.html#1540805">3.&nbsp;re: 今天收到阿里巴巴 人脉通体验邮件</a>
			</li>
			<li style="">
				建议关了此博客，整天在骗人。
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--jian11111111</li>
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl04_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/07/1451282.html#1535079">4.&nbsp;re: 新注册了个域名alirenmai.com大家看做个什么网站好？</a>
			</li>
			<li style="">
				快捷进入阿里人脉通： <a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html" target="_new"></a>
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--㊣阿华</li>
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl05_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/04/24/1442708.html#1512673">5.&nbsp;re: 马云涉足SNS社区? alikaixin.com正式启用</a>
			</li>
			<li style="">
				我加入了！
<br>
<br><a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html" target="_new" rel="nofollow"></a>
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--龙的传人123</li>
		
			</ul>
		
</div>

<div class="container">
<div class="containerheader"><h3>阅读排行榜</h3></div>
	
			<ul style="" class="containercontent">
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/578709.html">1.&nbsp;实战C#.NET--Spring.NET &amp; NHibernate的整合(10600)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579059.html">2.&nbsp;C#.NET编程----Spring.NET &amp; NHibernate整合(一)(8277)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html">3.&nbsp;C#.NET编程----Spring.NET &amp; NHibernate整合(三) (4117)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2007/11/06/950876.html">4.&nbsp;国内第一个支持Spring.NET/NHibernate/Ajax的开源的Framework(3955)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html">5.&nbsp;C#.NET编程----Spring.NET &amp; NHibernate整合(二)(3768)</a>
			</li>
		
			</ul>
		

</div>

<div class="container">
<div class="containerheader">
<h3>评论排行榜</h3>
</div>
	
			<ul style="" class="containercontent">
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2007/08/24/868513.html">1.&nbsp;FastSpring.NET V2.05 RC1 发布[包含全部源代码](25)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2007/11/06/950876.html">2.&nbsp;国内第一个支持Spring.NET/NHibernate/Ajax的开源的Framework(21)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/05/582973.html">3.&nbsp;OASystemWeb of Spring.NET &amp; NHibernate 发布V0.1(15)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/578709.html">4.&nbsp;实战C#.NET--Spring.NET &amp; NHibernate的整合(15)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579059.html">5.&nbsp;C#.NET编程----Spring.NET &amp; NHibernate整合(一)(14)</a>
			</li>
		
			</ul>
		
</div>

							
		</div>
		<div id="right">
			
					
<div class="container">
	<div class="containerheader"><h3>View Post</h3></div>
	<div class="containercontent">
	<div class="post">
		<h2>
			<a id="ctl03_TitleUrl" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html">C#.NET编程----Spring.NET &amp; NHibernate整合(二)</a>
		</h2>
		<p>&nbsp;</p>
<p><a name="_Toc152731343"><strong><span style="font-size: 15pt; font-family: 宋体;">第一个</span><span style="font-size: 15pt; font-family: 黑体;" lang="EN">NHibernate </span><span style="font-size: 15pt; font-family: 宋体;">程序</span></strong></a></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">任何熟悉<span lang="EN-US">Hibernate</span>的人会发现这篇指南和<span lang="EN-US">Glen Smith </span>的<span lang="EN-US"> A Hitchhiker's Guide to Hibernate </span>非常相近。这里的内容正是基于他的指南，因此所有的感谢都应该给与他。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;" lang="EN-US">NHibernate</span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">的文档并非每处都和<span lang="EN-US">Hibernate</span>的文档一致。然而，项目的相似应该能使读者通过读<span lang="EN-US">Hibernate</span>的文档来很好的理解<span lang="EN-US">NHibernate</span>如何工作。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">这篇文档意在让你尽可能快的开始使用<span lang="EN-US">NHibernate</span>。它将介绍如何持久化一个简单的对象到一张表里。想得到更多的复杂的例子，可以参考<span lang="EN-US">NUnit</span>测试及附带代码。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">我们将进行以下步骤。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;" lang="EN-US">1</span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">．新建一个将要持久化<span lang="EN-US">.Net</span>对象的表<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;" lang="EN-US">2</span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">．构建一个可以让<span lang="EN-US">NHibernate</span>知道如何持久化对象属性的映射文件<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;" lang="EN-US">3</span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">．构建一个需要被持久化的<span lang="EN-US">.Net</span>类<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;" lang="EN-US">4</span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">．构建一个存放<span lang="EN-US">NHibernater</span>的配置文件的对像<span lang="EN-US"><o:p></o:p></span></span></p>
<span style="font-size: 12pt; font-family: 宋体;" lang="EN-US">5</span><span style="font-size: 12pt; font-family: 宋体;">．使用<span lang="EN-US">NHibernate</span>的<span lang="EN-US">API</span>测试你的第一个<span lang="EN-US">NHibernate</span>程序<br>
<br>
<span style="font-size: 12pt; font-family: 宋体;"><strong>新建项目<br>
<br>
</strong><span style="font-size: 12pt; font-family: 宋体;">项目名称为：<span lang="EN-US">NHibernateSample</span>，名字空间：</span><span style="font-size: 9pt; font-family: 新宋体;" lang="EN-US">OKEC.Sample.NHibernate<br>
<br>
<br>
<br>
<span style="font-size: 12pt; font-family: 宋体;"><strong>建立数据表<br>
<br>
</strong><span style="font-size: 12pt; font-family: 宋体;">数据库为<span lang="EN-US">SQLServer2000</span>，表名为：</span><span style="font-size: 9pt; color: green; font-family: 新宋体;" lang="EN-US">my_users<br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: 9pt; font-family: 宋体;" lang="EN-US"><font color="#000000"><br>
</font></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><font color="#000000"><img alt="" src="none.gif" align="top"><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">exists</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="color: rgb(0, 0, 255);">select</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">from</span><span style="color: rgb(0, 0, 0);">&nbsp;dbo.sysobjects&nbsp;</span><span style="color: rgb(0, 0, 255);">where</span><span style="color: rgb(0, 0, 0);">&nbsp;id&nbsp;</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 255);">object_id</span><span style="color: rgb(0, 0, 0);">(N</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(255, 0, 0);">[dbo].[my_users]</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">)&nbsp;</span><span style="color: rgb(128, 128, 128);">and</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 255);">OBJECTPROPERTY</span><span style="color: rgb(0, 0, 0);">(id,&nbsp;N</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(255, 0, 0);">IsUserTable</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">)&nbsp;</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="font-weight: bold; color: rgb(128, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">drop</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">table</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">dbo</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">my_users</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">GO</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">CREATE</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">dbo</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">my_users</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;(<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">LogonId</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">varchar</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 0, 0);">)&nbsp;COLLATE&nbsp;Chinese_PRC_CI_AS&nbsp;</span><span style="color: rgb(128, 128, 128);">NOT</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">NULL</span><span style="color: rgb(0, 0, 0);">&nbsp;,<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">UserName</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">varchar</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 0, 0);">)&nbsp;COLLATE&nbsp;Chinese_PRC_CI_AS&nbsp;</span><span style="color: rgb(0, 0, 255);">NULL</span><span style="color: rgb(0, 0, 0);">&nbsp;,<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">Password</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">varchar</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 0, 0);">)&nbsp;COLLATE&nbsp;Chinese_PRC_CI_AS&nbsp;</span><span style="color: rgb(0, 0, 255);">NULL</span><span style="color: rgb(0, 0, 0);">&nbsp;,<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">EmailAddress</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">varchar</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 0, 0);">)&nbsp;COLLATE&nbsp;Chinese_PRC_CI_AS&nbsp;</span><span style="color: rgb(0, 0, 255);">NULL</span><span style="color: rgb(0, 0, 0);">&nbsp;,<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">LastLogon</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">datetime</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">NULL</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)&nbsp;</span><span style="color: rgb(0, 0, 255);">ON</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">PRIMARY</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">GO</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">ALTER</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">dbo</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">my_users</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ADD</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">CONSTRAINT</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">PK_my_users</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">PRIMARY</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">KEY</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">CLUSTERED</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">LogonId</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">ON</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">PRIMARY</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&nbsp;<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">GO</span><span style="color: rgb(0, 0, 0);"><img alt="" src="none.gif" align="top"></span></font></div>
<font color="#000000"><br>
<span style="font-size: 12pt; font-family: 宋体;"><strong><br>
<br>
<br>
建立<span lang="EN-US">XML</span>对像映射文件<br>
<br>
</strong><span style="font-size: 12pt; font-family: 宋体;">现在我们有数据表和需要去映射它的<span lang="EN-US">.Net</span>类。我们需要一种方式去让<span lang="EN-US">NHibernate</span>知道如何从一个映射到另一个。这个任务依赖于映射文件来完成。最易于管理的办法是为每一个类写一个映射文件，如果你命名它是<span lang="EN-US">User.hbm.xml</span>并且把它放在和类的同一个目录里，<span lang="EN-US">NHiberante</span>将会使得事情简单起来。下面是<span lang="EN-US">User.hbm.xml</span>的例子：<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img alt="" src="none.gif" align="top"><span style="color: rgb(128, 128, 128);">&lt;</span><span style="color: rgb(0, 0, 0);">?xml&nbsp;version</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="font-weight: bold; color: rgb(128, 0, 0);">1.0</span><span style="color: rgb(0, 0, 0);">"&nbsp;encoding</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"utf</span><span style="color: rgb(128, 128, 128);">-</span><span style="font-weight: bold; color: rgb(128, 0, 0);">8</span><span style="color: rgb(0, 0, 0);">"&nbsp;?</span><span style="color: rgb(128, 128, 128);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top"></span><span style="color: rgb(128, 128, 128);">&lt;</span><span style="color: rgb(0, 0, 0);">hibernate</span><span style="color: rgb(128, 128, 128);">-</span><span style="color: rgb(0, 0, 0);">mapping&nbsp;xmlns</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"urn:nhibernate</span><span style="color: rgb(128, 128, 128);">-</span><span style="color: rgb(0, 0, 0);">mapping</span><span style="color: rgb(128, 128, 128);">-</span><span style="font-weight: bold; color: rgb(128, 0, 0);">2.0</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(128, 128, 128);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;</span><span style="color: rgb(0, 0, 0);">class&nbsp;name</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"&nbsp;OKEC.Sample.NHibernate.NHibernateTest.</span><span style="color: rgb(255, 0, 255);">User</span><span style="color: rgb(0, 0, 0);">,NHibernateSample"&nbsp;</span><span style="color: rgb(0, 0, 255);">table</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"my_users"</span><span style="color: rgb(128, 128, 128);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;</span><span style="color: rgb(0, 0, 0);">id&nbsp;name</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"Id"&nbsp;</span><span style="color: rgb(0, 0, 255);">column</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"LogonId"&nbsp;type</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"String"&nbsp;length</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="font-weight: bold; color: rgb(128, 0, 0);">20</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(128, 128, 128);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;</span><span style="color: rgb(0, 0, 0);">generator&nbsp;class</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"assigned"&nbsp;</span><span style="color: rgb(128, 128, 128);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/</span><span style="color: rgb(0, 0, 0);">id</span><span style="color: rgb(128, 128, 128);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"UserName"&nbsp;</span><span style="color: rgb(0, 0, 255);">column</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"UserName"&nbsp;type</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"String"&nbsp;length</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="font-weight: bold; color: rgb(128, 0, 0);">40</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(128, 128, 128);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"Password"&nbsp;</span><span style="color: rgb(0, 0, 255);">column</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"Password"&nbsp;type</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"String"&nbsp;length</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="font-weight: bold; color: rgb(128, 0, 0);">20</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(128, 128, 128);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"EmailAddress"&nbsp;</span><span style="color: rgb(0, 0, 255);">column</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"EmailAddress"&nbsp;type</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"String"&nbsp;length</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="font-weight: bold; color: rgb(128, 0, 0);">40</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(128, 128, 128);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"LastLogon"&nbsp;</span><span style="color: rgb(0, 0, 255);">column</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"LastLogon"&nbsp;type</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="font-weight: bold; color: rgb(0, 0, 0);">DateTime</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(128, 128, 128);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/</span><span style="color: rgb(0, 0, 0);">class</span><span style="color: rgb(128, 128, 128);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;<br>
<img alt="" src="none.gif" align="top"></span><span style="color: rgb(128, 128, 128);">&lt;/</span><span style="color: rgb(0, 0, 0);">hibernate</span><span style="color: rgb(128, 128, 128);">-</span><span style="color: rgb(0, 0, 0);">mapping</span><span style="color: rgb(128, 128, 128);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top"></span></div>
<br>
<span style="font-size: 12pt; font-family: 宋体;">注意事项：在<span lang="EN-US">Visual Studio 2003/2005</span>中要将此文件的属性设置为“嵌入的资源”（<span lang="EN-US">Embedded Resource</span>）<br>
<br>
<br>
<br>
<span style="font-size: 12pt; font-family: 宋体;"><strong>建立对像<br>
<br>
</strong>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-family: 宋体;">对像定义：<span lang="EN">User.cs<br>
</span></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System;<br>
</span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;OKEC.Sample.NHibernate.NHibernateTest<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;summary&gt;</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;Summary&nbsp;description&nbsp;for&nbsp;User.<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/summary&gt;</span><span style="color: rgb(128, 128, 128);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;User<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;id;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;userName;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;password;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;emailAddress;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime&nbsp;lastLogon;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;User()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;Id&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;id;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;id&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;UserName&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;userName;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;userName&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;Password&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;password;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;password&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;EmailAddress&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;emailAddress;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;emailAddress&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime&nbsp;LastLogon&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;lastLogon;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;{&nbsp;lastLogon&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 150%;"><br>
<br>
<span style="font-size: 10.5pt; font-family: 宋体;"><strong>编写<span lang="EN">Nhibernate</span>的初始化配置程序<br>
</strong><br>
<span style="font-size: 10.5pt; font-family: 宋体;">程序名：<span lang="EN">MyConfiguration.cs<br>
</span></span></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;NHibernate.Cfg;<br>
</span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;OKEC.Sample.NHibernate.NHibernateTest<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;summary&gt;</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;MyConfiguration&nbsp;的摘要说明。<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/summary&gt;</span><span style="color: rgb(128, 128, 128);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;MyConfiguration<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;MyConfiguration()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;在此处添加构造函数逻辑<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//<br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;Configuration&nbsp;GetConfig()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configuration&nbsp;cfg&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;Configuration();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfg.SetProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.connection.provider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernate.Connection.DriverConnectionProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">请修改此行中的SQLServer的配置</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfg.SetProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.connection.connection_string</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Data&nbsp;Source=192.168.88.15;Database=liluhua;User&nbsp;ID=sa;Password=sa;Trusted_Connection=False</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfg.SetProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.dialect</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernate.Dialect.MsSql2000Dialect</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfg.SetProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.connection.driver_class</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernate.Driver.SqlClientDriver</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfg.AddAssembly(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernateSample</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;cfg;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);">(Exception&nbsp;ex)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(ex.Message);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(ex.StackTrace);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</span></div>
<br>
<br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 150%;"><br>
<span style="font-size: 12pt; font-family: 宋体;"><strong>编写调用程序<br>
<br>
</strong></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-family: 宋体;">准备好上面的一切，我们就可以开始编辑启动程序，来测试你的第一个<span lang="EN">Nhibernate</span>程序了。<span lang="EN"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 10.5pt; font-family: 宋体;">程序名：<span lang="EN">UserFixture.cs<br>
</span></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Collections;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;NHibernate;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;NHibernate.Cfg;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;NHibernate.Expression;<br>
</span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;OKEC.Sample.NHibernate.NHibernateTest<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;summary&gt;</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;UserFixture&nbsp;的摘要说明。<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/summary&gt;</span><span style="color: rgb(128, 128, 128);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;UserFixture<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;UserFixture()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;在此处添加构造函数逻辑<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//<br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;ValidateQuickStart()&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">得到NHibernate的配置</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MyConfiguration&nbsp;config&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;MyConfiguration();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configuration&nbsp;cfg&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;config.GetConfig();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ISessionFactory&nbsp;factory&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;cfg.BuildSessionFactory();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ISession&nbsp;session&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;factory.OpenSession();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ITransaction&nbsp;transaction&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;session.BeginTransaction();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User&nbsp;newUser&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;(User)session.Load(</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(User),&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">joe_cool</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(newUser</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;User();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.Id&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">joe_cool</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.UserName&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Joseph&nbsp;Cool</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.Password&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">abc123</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.EmailAddress&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><span><a href="mailto:joe@cool.com" class="smarterwiki-linkify">joe@cool.com</a></span></span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.LastLogon&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime.Now;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;Tell&nbsp;NHibernate&nbsp;that&nbsp;this&nbsp;object&nbsp;should&nbsp;be&nbsp;saved</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.Save(newUser);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;commit&nbsp;all&nbsp;of&nbsp;the&nbsp;changes&nbsp;to&nbsp;the&nbsp;DB&nbsp;and&nbsp;close&nbsp;the&nbsp;ISession</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;transaction.Commit();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.Close();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;open&nbsp;another&nbsp;session&nbsp;to&nbsp;retrieve&nbsp;the&nbsp;just&nbsp;inserted&nbsp;user</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;factory.OpenSession();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User&nbsp;joeCool&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;(User)session.Load(</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(User),&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">joe_cool</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;set&nbsp;Joe&nbsp;Cool's&nbsp;Last&nbsp;Login&nbsp;property</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;joeCool.LastLogon&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime.Now;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;flush&nbsp;the&nbsp;changes&nbsp;from&nbsp;the&nbsp;Session&nbsp;to&nbsp;the&nbsp;Database</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.Flush();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IList&nbsp;recentUsers&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;session.CreateCriteria(</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(User))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Add(Expression.Gt(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">LastLogon</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime(</span><span style="color: rgb(0, 0, 0);">2004</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 0);">03</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 0);">14</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 0);">20</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.List();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">foreach</span><span style="color: rgb(0, 0, 0);">(User&nbsp;user&nbsp;</span><span style="color: rgb(0, 0, 255);">in</span><span style="color: rgb(0, 0, 0);">&nbsp;recentUsers)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Assert.IsTrue(user.LastLogon&nbsp;&gt;&nbsp;(new&nbsp;DateTime(2004,&nbsp;03,&nbsp;14,&nbsp;20,&nbsp;0,&nbsp;0))&nbsp;);&nbsp;</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(user.UserName);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(user.Password);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.Close();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);">(Exception&nbsp;ex)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(ex.Message);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(ex.StackTrace);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.ReadLine();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</span></div>
<br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 150%;"><br>
<br>
<span style="font-size: 12pt; font-family: 宋体;"><strong>测试你的程序<br>
<br>
</strong><span style="font-size: 12pt; font-family: 宋体;">如果运行后没有出错，显示了结果，说明你的第一个<span lang="EN-US">NHibernate</span>程序成功了。<br>
如果会如下：<br>
</span></span></p></span></span></span></span></font></span></span><o:p><p></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><font color="#000000"><img alt="" src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">Joseph&nbsp;Cool<br>
<img alt="" src="none.gif" align="top">abc123<br>
<img alt="" src="none.gif" align="top"></span></font></div>
</o:p></span></span></span><font color="#000000"></font><br>
<br>
<br>
<span style="color: rgb(128, 128, 128);"><em><font face="宋体">文档中的项目源代码请从以下地址下载：<br>
</font></em></span><a href="http://www.springframework.cn/read.php?fid=8&amp;tid=2&amp;toread=1"><span style="color: rgb(128, 128, 128);"><em><font face="宋体">http://www.springframework.cn/read.php?fid=8&amp;tid=2&amp;toread=1</font></em></span></a><a href="http://www.springframework.cn/htm_data/8/0611/2.html"></a><br>
<em><span style="color: rgb(128, 128, 128);"><font face="宋体">完整的文档请下载PDF文档：<br>
</font></span></em><a href="http://www.springframework.cn/read.php?fid=2&amp;tid=1&amp;toread=1"><span style="color: rgb(128, 128, 128);"><em><font face="宋体">http://www.springframework.cn/read.php?fid=2&amp;tid=1&amp;toread=1</font></em></span></a><font face="宋体"> </font>

<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(579060,23118,1)"> 
		<span class="diggnum" id="digg_count_579060">1</span>
	</div>
	<div class="buryit" onclick="DiggIt(579060,23118,2)"> 
		<span class="burynum" id="bury_count_579060">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_579060">0</span>	
	<div class="diggword" id="digg_word_579060">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579059.html">« </a> 上一篇：<a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579059.html" title="发布于2006-12-01 15:23">C#.NET编程----Spring.NET &amp; NHibernate整合(一)</a><br>
<a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html">» </a> 下一篇：<a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html" title="发布于2006-12-01 15:45">C#.NET编程----Spring.NET &amp; NHibernate整合(三) </a><br>
</div>








		<p class="postfoot">
			posted on 2006-12-01 15:27 <a href="http://www.cnblogs.com/it1630/">㊣阿华</a> 阅读(3768) <a href="#commentform">评论(9)</a> &nbsp;<a href="http://www.cnblogs.com/it1630/admin/EditPosts.aspx?postid=579060">编辑</a> <a href="http://www.cnblogs.com/it1630/AddToFavorite.aspx?id=579060">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  
		</p>
	</div>
	<img src="579060.html" height="1" width="1">
	
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html"
dc:identifier="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/it1630/services/trackbacks/579060.aspx" />
</rdf:RDF>
-->

	</div>
</div>
	<a name="pagedcomment"></a>
<div class="container">
	<div class="containerheader"><h3>View Comments</h3></div>	
	<div id="comments" class="containercontent">
		<span id="span_comment_maxid" style="display: none;">1499165</span>
		
				<div class="post">
					<h5>
						<a href="#579264">#1楼</a><a name="579264" id="comment_anchor_579264"></a>
						&nbsp;&nbsp;<a onclick='ReplyComment("Cameo",579264,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(579264,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl00$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_EditLink"></a>
					</h5>
					<span id="comment_body_579264" class="blog_comment_body">兄弟，今天才发布！真郁闷，前几天学Spring.net找不到资料！</span>
					<div class="postfoot">
						2006-12-01 17:49 | <a id="Comments1_CommentList_ctl00_NameLink" target="_blank">Cameo[未注册用户]</a>
					</div>
				</div>
			
				<div class="post">
					<h5>
						<a href="#580196">#2楼</a><a name="580196" id="comment_anchor_580196"></a>
						&nbsp;&nbsp;<a onclick='ReplyComment("㊣阿华[匿名]",580196,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(580196,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl01$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_EditLink"></a>
					</h5>
					<span id="comment_body_580196" class="blog_comment_body">我也是才开始研究Spring.NET,之前一直在做Spring for Java.
<br>
<br>大家一起学习吧。
<br>
<br>我会把我所学的东西慢慢贴到我的博客和我的论坛上。
<br>
<br><a target="_new" href="http://tech.bokeecn.com/">http://tech.bokeecn.com</a></span>
					<div class="postfoot">
						2006-12-02 23:32 | <a id="Comments1_CommentList_ctl01_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://tech.bokeecn.com" target="_top">㊣阿华[匿名][未注册用户]</a>
					</div>
				</div>
			
				<div class="post">
					<h5>
						<a href="#1315996">#3楼</a><a name="1315996" id="comment_anchor_1315996"></a>
						&nbsp;&nbsp;<a onclick='ReplyComment("NoText",1315996,"zmX5gh9iKquNZrzlFwi4mecqU+2h4Z1BuoOwXMJyZfAOt6UM1pQYXw==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1315996,"zmX5gh9iKquNZrzlFwi4mecqU+2h4Z1BuoOwXMJyZfAOt6UM1pQYXw==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=NoText" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl02$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_EditLink"></a>
					</h5>
					<span id="comment_body_1315996" class="blog_comment_body">谢谢楼主分析，深入浅出简单明了，写得太好了</span>
					<div class="postfoot">
						2008-09-12 16:20 | <a id="Comments1_CommentList_ctl02_NameLink" href="http://www.cnblogs.com/notext/" target="_top">NoText</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/NoText" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
				</div>
			
				<div class="post">
					<h5>
						<a href="#1382794">#4楼</a><a name="1382794" id="comment_anchor_1382794"></a>
						&nbsp;&nbsp;<a onclick='ReplyComment("白狐",1382794,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1382794,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl03$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_EditLink"></a>
					</h5>
					<span id="comment_body_1382794" class="blog_comment_body">谢谢 楼主的帖子 真的 值得学习 </span>
					<div class="postfoot">
						2008-11-26 16:50 | <a id="Comments1_CommentList_ctl03_NameLink" target="_blank">白狐[未注册用户]</a>
					</div>
				</div>
			
				<div class="post">
					<h5>
						<a href="#1387580">#5楼</a><a name="1387580" id="comment_anchor_1387580"></a>
						&nbsp;&nbsp;<a onclick='ReplyComment("鱼蛋",1387580,"7idvy9MIpgZn7/S1jMn9tVQTpJYtepizbWZzT0XEMjVR2+nymCzwQQ==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1387580,"7idvy9MIpgZn7/S1jMn9tVQTpJYtepizbWZzT0XEMjVR2+nymCzwQQ==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e9%b1%bc%e8%9b%8b" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl04$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_EditLink"></a>
					</h5>
					<span id="comment_body_1387580" class="blog_comment_body">程序的命名空间名字起的太sb了,和Spring,NHibernate都冲突了</span>
					<div class="postfoot">
						2008-12-01 15:55 | <a id="Comments1_CommentList_ctl04_NameLink" href="http://www.cnblogs.com/asuka08/" target="_top">鱼蛋</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e9%b1%bc%e8%9b%8b" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
				</div>
			
				<div class="post">
					<h5>
						<a href="#1388275">#6楼</a><a name="1388275" id="comment_anchor_1388275"></a>
						&nbsp;&nbsp;<a onclick='ReplyComment("白狐",1388275,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1388275,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl05$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_EditLink"></a>
					</h5>
					<span id="comment_body_1388275" class="blog_comment_body">我做鄙视 那种自以为是的 SB 5楼的 这种人  你有本事 你也去写一篇啊 
<br>就算 楼主程序写的 有问题 你也不能用过激的言语  </span>
					<div class="postfoot">
						2008-12-02 09:59 | <a id="Comments1_CommentList_ctl05_NameLink" target="_blank">白狐[未注册用户]</a>
					</div>
				</div>
			
				<div class="post">
					<h5>
						<a href="#1499165">#7楼</a><a name="1499165" id="comment_anchor_1499165"></a><a name="Post"></a>
						&nbsp;&nbsp;<a onclick='ReplyComment("寂寞高手",1499165,"sPPL2iG2YnpWV7Bxu45UGTfXL4I+2A6FWExyI/2MapVOeXQjJHixwQ==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1499165,"sPPL2iG2YnpWV7Bxu45UGTfXL4I+2A6FWExyI/2MapVOeXQjJHixwQ==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e5%af%82%e5%af%9e%e9%ab%98%e6%89%8b" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl06$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_EditLink"></a>
					</h5>
					<span id="comment_body_1499165" class="blog_comment_body">楼主写的不错，继续关注。
<br>by the way,5楼这样说话只能有损自己做人的尊严。</span>
					<div class="postfoot">
						2009-04-09 17:10 | <a id="Comments1_CommentList_ctl06_NameLink" href="http://www.cnblogs.com/laiss/" target="_top">寂寞高手</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e5%af%82%e5%af%9e%e9%ab%98%e6%89%8b" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
				</div>
			
	</div>
</div>

<div id="ctl04_comment_form" class="commentform">




<div id="ctl04_divLoginPannel">
<div class="login_tips">注册用户登录后才能发表评论，请 <a href="http://passport.cnblogs.com/login.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fit1630%2farchive%2f2006%2f12%2f01%2f579060.html%3flogin%3d1%23commentform" class="underline">登录</a> 或 <a href="http://passport.cnblogs.com/register.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fit1630%2farchive%2f2006%2f12%2f01%2f579060.html%23Bottom2" class="underline">注册</a> 。</div>
</div>

<div class="itnews c_ad_block" id="itnews">
<a href="http://news.cnblogs.com/" target="_top">IT新闻</a>:<br>

          ·  <a href="http://news.cnblogs.com/n/55129/" target="_top">雅虎或收购本地搜索和评论提供商Yelp</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55128/" target="_top">百度销售员工战黑回忆：电话声像战前冲锋号</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55127/" target="_top">苹果再度反击 要求ITC封杀诺基亚</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55126/" target="_top">【快乐周末】Google 最新产品： Google Toilet</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55125/" target="_top">纽约时报：Google与中国</a><br>
	
</div>


<div id="ad_under_comment" class="c_ad_block">
<a href="http://a4.yeshj.com/rd/34138/" target="_top">每天10分钟，轻松学英语</a><br><br>
<div id="google_ads_div_cnblogs_blogpost_bottom1">
<iframe src="index_2.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom1" id="google_ads_iframe_cnblogs_blogpost_bottom1" scrolling="no" frameborder="0" height="60" width="468"></iframe></div>

<br>
<div id="google_ads_div_cnblogs_blogpost_bottom">
<iframe src="index_3.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom" id="google_ads_iframe_cnblogs_blogpost_bottom" scrolling="no" frameborder="0" height="250" width="300"></iframe></div>

</div>
<div id="site_nav_under" class="c_ad_block">
网站导航：<br>
<a href="http://www.cnblogs.com/" target="_top">博客园首页</a> &nbsp;<a href="http://news.cnblogs.com/" target="_top">IT新闻</a> &nbsp;<a href="http://home.cnblogs.com/" target="_top">个人主页</a> &nbsp;<a href="http://home.cnblogs.com/ing/" target="_top">闪存</a> &nbsp;<a href="http://job.cnblogs.com/" target="_top">程序员招聘</a> &nbsp;<a href="http://space.cnblogs.com/" target="_top">社区</a> &nbsp;<a href="http://space.cnblogs.com/q/" target="_top">博问</a> &nbsp;<a href="http://wz.cnblogs.com/" target="_top">网摘</a>
</div>
<div id="ad_under_comment2" class="c_ad_block">
<a href="http://www.china-pub.com/STATIC07/0912/zh_ndcx_091212.asp" target="_top"><img src="chinapub_20091222.jpg" alt="" style="border: 0px none ;"></a><br>
<a href="http://www.china-pub.com/itbook/" target="_top">China-pub 计算机图书网上专卖店！6.5万品种2-8折！</a><br>
<a href="http://www.china-pub.com/static07/0901/zh_jueba_090121.asp" target="_top">China-Pub 计算机绝版图书按需印刷服务</a><br>
</div>

<div id="relative_search"><br><b>在知识库中查看：</b><br> <a href="http://kb.cnblogs.com/a/579060/">C#.NET编程----Spring.NET &amp; NHibernate整合(二)</a></div>

</div>


				
		</div>
	</div>	
	<div class="clearing">&nbsp;</div>
</div>
<div id="footer">
	
Powered by:<br> 

<a id="Footer1_Hyperlink3" name="Hyperlink1" href="http://www.cnblogs.com/" style="font-family: Verdana; font-size: 12px;">博客园</a><br>
Copyright © ㊣阿华

</div>
    </form>
	
	
      
    
    
    
</body>
</html>
